package com.sys.users.pojo;


import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.sys.common.pojo.BasePojo;

/**
 * 管理员表
 * 
 * @author lby
 *
 */
public class AAdmins extends BasePojo<AAdmins>
{
	private int adminId;
	private String adminName;
	private String adminPassword;
	private String loginName;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date lastLoginTime;
	
	private String statusStr;
	
	/*
	 * 方便枚举项在网页上显示出来 键为值(数字), 值为字符串描述 只提供get方法
	 */
	private Map<String, String> enumsMap = new TreeMap<String, String>();

	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		AAdminsEnum[] adminsEnums = AAdminsEnum.values();
		for (int i = 0; i < adminsEnums.length; i++)
		{
			AAdminsEnum adminsEnum = adminsEnums[i];
			String key = adminsEnum.toString();
			enumsMap.put(key + "-" + adminsEnum.getStatus() + "", adminsEnum.getName());
		}
		return enumsMap;
	}
	
	public String getStatusStr()
	{
		AAdminsEnum[] values = AAdminsEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AAdminsEnum adminsEnumTemp = values[i];
			if (adminsEnumTemp.toString().startsWith("STATUS"))
			{
				if (adminsEnumTemp.getStatus() == this.status)
				{
					this.statusStr = adminsEnumTemp.getName();
				}
			}
		}

		return statusStr;
	}
	
	
	public int getAdminId()
	{
		return adminId;
	}
	public void setAdminId(int adminId)
	{
		this.adminId = adminId;
	}
	public String getAdminName()
	{
		return adminName;
	}
	public void setAdminName(String adminName)
	{
		this.adminName = adminName;
	}
	public String getAdminPassword()
	{
		return adminPassword;
	}
	public void setAdminPassword(String adminPassword)
	{
		this.adminPassword = adminPassword;
	}
	public String getLoginName()
	{
		return loginName;
	}
	public void setLoginName(String loginName)
	{
		this.loginName = loginName;
	}
	public byte getStatus()
	{
		return status;
	}
	public void setStatus(byte status)
	{
		this.status = status;
	}
	public Date getCreateTime()
	{
		return createTime;
	}
	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}
	public Date getUpdateTime()
	{
		return updateTime;
	}
	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}
	public Date getLastLoginTime()
	{
		return lastLoginTime;
	}
	public void setLastLoginTime(Date lastLoginTime)
	{
		this.lastLoginTime = lastLoginTime;
	}

	
}
